package com.novax.ex.activity.provider.service;

import com.novax.ex.activity.infrastructure.entity.OperationV2Rule;
import com.novax.ex.activity.infrastructure.mapper.OperationV2RuleMapper;
import com.novax.ex.activity.open.model.response.OperationV2RuleResponse;
import com.novax.ex.common.base.BaseMapper;
import com.novax.ex.common.base.BaseService;
import com.novax.ex.common.results.ReturnResult;
import org.springframework.stereotype.Service;

import jakarta.annotation.Resource;
import java.util.List;

/**
 * @Description 活动落地页配置 标题与规则V2
 * @Author ChenXi
 * @Date 2023/04/18/10:08
 */

@Service
public class OperationV2RuleService extends BaseService {

    @Resource
    private OperationV2RuleMapper operationV2RuleMapper;

    @Override
    protected BaseMapper getBaseMapper() {
        return operationV2RuleMapper;
    }

    /**
     * @Description: 查询规则多语言配置
     * @Author: ChenXi
     * @Date:  2024/4/25 15:47
     * @param operationId
     * @return: com.novax.ex.common.results.ReturnResult<java.util.List<com.novax.ex.activity.open.model.response.OperationV2RuleResponse>>
     **/
    public List<OperationV2Rule> list(Long operationId) {
        return operationV2RuleMapper.selectListFromOperationId(operationId);
    }

    /**
     * @Description: 判断此活动id和语言是否已配置文案
     * @Author: ChenXi
     * @Date:  2023/4/19 11:22
     * @param operationId
     * @param language
     * @return: void
     **/
    public Long queryOperationIdAndLanguage(Long operationId, String language) {
        return operationV2RuleMapper.queryOperationIdAndLanguage(operationId, language);
    }

}
